<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['运输任务','审核异常[流向管控]']" icon="fa fa-truck" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>审核异常[流向管控]</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
								<div class="top_module">
									<span class="module_text">订单编号</span>
									<input class="module_inp" [(ngModel)]="orderTaskId"/>
								</div>
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								
								<div class="top_module">
									<span class="module_text">订单状态</span>
									<select name="" id="" class="module_inp" [(ngModel)]="orderStatus"  >
										<option value="">全部</option>
										<option value="0">待处理</option>
										<option value="1">已处理</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' [specifyTime]="InputTime" (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="manual_push()">手动推送</button>
								
								
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌,设备ID,描述,处理人...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<!--<th style="width: 55px;"><input type="checkbox" (change)="selectFn()" /></th>-->
										<th>订单编号</th>
										<th>公司名称</th>
										<th>车牌号码</th>
										<th>设备ID</th>
										<th>空车过磅时间</th>
										<th>重车过磅时间</th>
										<th>净重</th>
										<th>订单类型</th>
										<th>开始卸货时间</th>
										<th>卸货结束时间</th>
										<th>异常描述</th>
										<th>推送时间</th>
										<th>推送状态</th>
										<th>处理人</th>
										<th>状态</th>
										<th>录入时间</th>
										<th>更新时间</th>
										<th>操作</th>
										
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i"  [ngClass]="{selected:activeSelected === row.id}" (dblclick)='checkAbnormal(row)'>
										<!--<td><input type="checkbox" (change)="onCheckboxChangeFn(row.id)" /></td>-->
										<td>{{row.taskId}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.emptyLoadDate}}</td>
										<td>{{row.fullLoadDate}}</td>
										<td>{{row.weight}}</td>
										<td>
											<span  *ngIf="row.type == '1'">水泥订单</span>
											<span  *ngIf="row.type == '2'">物资订单</span>
										</td>
										<td>{{row.unloadStartDate}}</td>
										<td>{{row.unloadEndDate}}</td>
										<td>{{row.remark}}</td>
										<td>{{row.pushDate}}</td>
										<td>
											<span  *ngIf="row.isPush=='0'" class="orange">未推送</span>
											<span  *ngIf="row.isPush=='1'" class="green">已推送</span>
										</td>
										<td>{{row.userName}}</td>
										<td>
											<span  *ngIf="row.status=='0'" class="orange">待处理</span>
					           				<span  *ngIf="row.status=='1'" class="green">已处理</span>
										
										</td>
										<td>{{row.createTime}}</td>
										<td>{{row.uploadTime}}</td>
										<td>
										    <button type="button" (click)="checkAbnormal(row)" >查看</button>
										    <button type="button" (click)="runMatlab(row,runMatlabModal)" >手动执行算法</button>
											<button type="button" (click)="pushItem(row)" >推送</button>
											<!--<button type="button" (click)="jumpOptimization(row)" >修复</button>-->
											<button type="button" (click)="delete_row(row)" >删除</button>
											<button type="button" (click)="jumpOrderManagenment(row)" >修复</button>
										</td>
										
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
		<!--折线图-->
	<div  style="background: white;border-radius: 5px;margin-top: 5px;position: relative;" [hidden]='!isChartView'>
		<button (click)="closeChart()" class="div_closeBtn"> × </button>
		<div class="widget-body no-padding" style="margin: 0;">
			<div class="page-header clearfix s_table_opreation" style="margin: 0;">
				<div class="left page-header-btn" style="padding: 5px;">
					<div class="top_module">
						<span class="module_text" style="background: none;" >异常数据折线图</span>
					</div>
					<div style="display: inline-block;">
						<div>
							<div class="selectDate top_module">
								<table-select-date [notInit]='true' [specifyId]='specifyId' [specifyTime]='specifyTime' (outerTime)="getSelectChartTime($event)" ></table-select-date>
							</div>
							<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
							<!--<button type="button" class="btn btn-primary" *ngIf="checkQuanxian&&quickAudit" (click)="modalCheckEvent();" >快速审核</button>-->
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<sa-chart-bmap [height]='325'  [inputParams]='selectedRow' [isBaiduMap]='true' (outerSend)="runParent($event)" (outerIsMap)='showMapView($event)' 
			[isAuditData]='false'	[isShowModify]='true'
		></sa-chart-bmap>
		<div [hidden]='!isMapView'>
			<sa-bmap-chart [trackParams]='drawTrackArr' [isShowBmap]='isMapView' deviceId="deviceId"></sa-bmap-chart>
		</div>
	</div>
	
	<!--  手动执行算法弹窗-->
    <div bsModal #runMatlabModal="bs-modal" id="lgModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" (click)="runMatlabCancel(runMatlabModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">手动执行算法</h4>
                </div>
                <div class="modal-body">
                    <div class="row form-horizontal">
                        <form class="form" role="form">
                            <div class="row" >
                                
                                <div class="form-group clearfix col-sm-12">
                                    <label class="control-label col-sm-2 no-padding-right">上货前置零</label>
                                    <div class="col-sm-9">
                                        <div class="clearfix">
                                            <input class="form-control" name="datePicker1" type="text" id="datePicker1" [ngModel]="zeroBeforeDate" placeholder="上货前置零时间[默认空磅时间]" />
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group clearfix col-sm-12">
                                    <label class="control-label col-sm-2 no-padding-right">卸货后置零</label>
                                    <div class="col-sm-9">
                                        <div class="clearfix">
                                            <input class="form-control" name="datePicker2" type="text" id="datePicker2" [ngModel]="zeroAfterDate" placeholder="卸货后置零时间" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" (click)="runMatlabCancel(runMatlabModal)">取消</button>
                    <button type="button" class="btn btn-primary" (click)="runMatlabConfirm(runMatlabModal)">确认</button>
                </div>
            </div>
        </div>
    </div>
    <!--弹窗end-->
	
</div>
